#ifndef __AMSI_H__
#define __AMSI_H__

#include <IceUtil/Mutex.h>
#include <map>

#include <FIPA.h>

using namespace std;

class AMSI: public FIPA::AMS
{
 public:
  AMSI
    (string platformName);
  ~AMSI();

  virtual void _cpp_register
    (const FIPA::AgentPrx&, 
     const Ice::Current&);
  virtual void deregister
    (const Ice::Identity&, 
     const Ice::Current&);
  virtual FIPA::AgentPrx search
    (const Ice::Identity&, 
     const Ice::Current&);
  virtual FIPA::ApDescription getDescription
    (const Ice::Current&);

 private:
  FIPA::ApDescription _desc;
  IceUtil::Mutex _m;
  typedef std::map
    <Ice::Identity, FIPA::AgentPrx>
    RMap;
  mutable RMap _agents;
};

typedef IceUtil::Handle<AMSI> AMSIPtr;

#endif
